google.load('jquery','1.4.4');

var congres;
var theme;
var lat;

function getCongres(annee_demandee){
	if (annee_demandee>0) {
		$.get('ajax.php', {
				typeRequest: "congres",
				annee:annee_demandee
			}, function(data){
			}
		);
	}
}

function addMarkers(data) {
	var geocoder = new google.maps.Geocoder();
	var addresses = new Array();
	for (var i=0; i < 2 ; i++) {
		addresses.push({address: data[i]["lieu"]});
	}
	alert(addresses.length);
	geocoder.geocode(addresses, 
		function (response, status) {
			if (response != null) {
				for (var j=0; j < response.length; j++) {
					var marker = new google.maps.Marker({
						position: response[j]["geometry"]["location"],
					    map: map,
					    title: data[j]["name"]});
				}
			}
		}
	);
}
/*
function add_marker(addr, name) {
	var geocoder = new google.maps.Geocoder();
	var request = {addr};
	geocoder.geocode(request, 
		function(response, status) {
			if (response != null) {
				var marker = new google.maps.Marker({
					position: response[0]["geometry"]["location"],
				    map: map,
				    title: name});
			}
		}
	);
}*/

function test(response, status,name) {
	/*
        
	google.maps.event.addListener(marker, 'click', function() {
		map.setCenter(response[0]["geometry"]["location"]);
		map.setZoom(18);
	});*/
}


function getTheme(annee_demandee){
	if(annee_demandee>0){
		$.get('ajax.php', { 
				typeRequest: "theme",
				annee:annee_demandee
			}, function(data){
			    theme = data;
			}
		);
	}
}

function getAllC(){
	$.get('ajax.php', {  
				typeRequest: "tout_C"
		}, function(data){
				congres = data;
				select_congress(congres);
		}
	);
}

function getAllT(){
	$.get('ajax.php', {  
				typeRequest: "tout_T"
		}, function(data){
				theme = data;
		}
	);
}